<style lang="scss">
	// @import '@/assets/css/variable'; 003792 01617a
	.question {
		// background-image: linear-gradient(to bottom, #003792, #01617a);
		
	}
</style>

<template>
	<div class="question wrapperContent2 bac-color-fff">
		<!-- <van-collapse v-model="activeNames">
		  <van-collapse-item v-for="(item,index) in list" :title="item.title" :name="index+1" :key="index">
			  <div v-html="item.content"></div>
		  </van-collapse-item>
		</van-collapse> -->
		<div class="collapse padding-lr-l">
			<div class="collapse-item" v-for="(item,index) in list" :key="index">
				<div class="collapse-item-title flex align-center justify-between fc-666" @click="clickTitle(index)">
					<span :style="{fontSize:fontSize==1?'14px':'18px'}">{{item.title}}</span>
					<van-icon :name="active===index?'arrow-down':'arrow'" />
				</div>
				<transition name="van-fade">
				  <div class="collapse-item-content line-h-l fc-999" :style="{fontSize:fontSize==1?'14px':'16px'}" v-show="active===index" v-html="item.content"></div>
				</transition>
			</div>
		</div>
	</div>
</template>
<script>
	import {
		Dialog,
		Toast
	} from "vant";
	import {
		mapGetters,
		mapActions
	} from "vuex";
	export default {
		name: 'question',
		components: {},
		data() {
			return {
				activeNames:[0],
				list:[],
				active:'',
				fontSize:localStorage.getItem('fontSize') || 1
			};
		},
		computed: {
			...mapGetters(['member']),
		},
		created() {
			this.newsList()
		},
		beforeDestroy() {

		},
		mounted() {
			// this.$nextTick(()=>{
			// 	var myCollection = document.getElementsByClassName("van-cell");
			// 	var i;
			// 	for (i = 0; i < myCollection.length; i++) {
			// 		myCollection[i].style.color = "red";
			// 		console.log('myCollection[i]', myCollection[i])
			// 	}
			// },500)
		},
		methods: {
			clickTitle(index) {
				if(this.active===index){
					this.active = ''
				}else{
					this.active = index
					console.log('clickTitle')
				}
			},
			newsList(){
				const params = {
					code:'problem',
					pageSize: 1000,
					currPage: 1
				}
				this.$request.newsList(params).then(res=>{
					this.list = res.data.list
				});
			}
		}
	}
</script>
